package top.ahzy.seobench.model.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 公共分页模型
 */
@ApiModel(value = "分页对象", description = "")
public class PageParam {

    @ApiModelProperty(value = "页数：页默认第一页", required = false)
    private Integer page = 1;
    @ApiModelProperty(value = "条数：页默10条", required = false)
    private Integer size = 10;
    @ApiModelProperty(value = "总数", required = false)
    private Integer count;
    @ApiModelProperty(value = "开始行", required = false)
    private Integer startRow;
    @ApiModelProperty(value = "结束行", required = false)
    private Integer endRow;

    public PageParam(){
        this.startRow = (page - 1) * size;
        this.endRow = page * size;
    }

    public PageParam(Integer page, Integer size){
        this.page = page;
        this.size = size;
        this.startRow = (page - 1) * size;
        this.endRow = page * size;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
        this.startRow = (page - 1) * size;
        this.endRow = page * size;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
        this.startRow = (page - 1) * size;
        this.endRow = page * size;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getStartRow() {
        return startRow;
    }

    public void setStartRow(Integer startRow) {
        this.startRow = startRow;
    }

    public Integer getEndRow() {
        return endRow;
    }

    public void setEndRow(Integer endRow) {
        this.endRow = endRow;
    }
}
